|
|
|
This declares a class Point
and defines an object apoint. You can think of a class definition as a
structure definition with functions (or ``methods''). Additionally, you
|
|
can specify the access
rights in more detail. For example, _x and _y are private, because elements
of classes are private as default. Consequently, we explicitly
|
|
must ``switch'' the access
rights to declare the following to be public. We do that by using the keyword
public followed by a colon: Every element following this
|
|
keyword are now accessible
from outside of the class.
|